<%@page import="enterprises.Enterprise"%>
<%@page import="org.codehaus.groovy.grails.web.context.ServletContextHolder"%>
<%=packageName%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title>Enterprise details</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="list" href="${createLink(action:"list")}"/>Enterprise List</a></span>          
        </div>
        <div class="body">        	
        	<h1>Enterprise Name: ${enterprise.name}  </h1>
        	
        	<table>             				            
                    <tbody>                    	
                    	<tr class="odd">
                    	  	<td>Registration number</td>                        	
                        	<td>${enterprise.registrationNumber}</td>						 					
                        </tr>
                        <tr class="even">
                    	  	<td>Address</td>                        	
                        	<td>${enterprise.address}</td>						 					
                        </tr>
                        <tr class="odd">
                    	  	<td>Telephone</td>                        	
                        	<td>${enterprise.telephone}</td>						 					
                        </tr>
                        <tr class="even">
                    	  	<td>Fax</td>                        	
                        	<td>${enterprise.fax}</td>						 					
                        </tr> 
                        <tr class="odd">
                    	  	<td>Count workers</td>                        	
                        	<td>${enterprise.countWorkers}</td>						 					
                        </tr>  
                        <tr class="even">
                    	  	<td>Man count</td>                        	
                        	<td>${enterprise.manCount}</td>						 					
                        </tr>                      
                        <tr class="odd">
                    	  	<td>Women count</td>                        	
                        	<td>${enterprise.womenCount}</td>						 					
                        </tr> 
                        <tr class="even">
                    	  	<td>ITR count</td>                        	
                        	<td>${enterprise.itrCount}</td>						 					
                        </tr> 
                        <tr class="odd">
                    	  	<td>Summary area</td>                        	
                        	<td>${enterprise.summaryArea}</td>						 					
                        </tr> 
                        <tr class="even">
                    	  	<td>Free area</td>                        	
                        	<td>${enterprise.freeArea}</td>						 					
                        </tr>
                        <tr class="odd">
                    	  	<td>Busy area</td>                        	
                        	<td>${enterprise.busyArea}</td>						 					
                        </tr>
                        <tr class="even">
                    	  	<td>Possible building area</td>                        	
                        	<td>${enterprise.possibleBuildingArea}</td>						 					
                        </tr> 
                    </tbody>
                   
            </table>
        	
			<h2>Providers</h2>
			<div class="list">
                <table>
                    <thead>
                        <tr>
                        		<th>Name</th>
                        		<th>Product</th>
                        																								
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${enterprise.providers}" status="i" var="${provider}">
                        <tr class="\${(i % 2) == 0 ? 'odd' : 'even'}">
                        	<td>${provider.name}</td>                        	
                        	<td>${provider.primaryProduct}</td>						 					
                        </tr>
                    </g:each>
                    </tbody>
                </table>               
            </div>      
            <h2>Productions</h2>
            <g:each in="${enterprise.productions}" var="${production}">            	
            	<div class="list">
            		
            	
                	<table>
                    	<thead>
                        	<tr>
                        		<th>Name</th>
                        		<th>Monthly size</th>
                        		<th>Consumers</th>                        																							
                        	</tr>
						</thead>                        	
                        <tbody>
                        	<tr>
                        		<td>${production}</td>
                        		<td>${production.monthlySize}</td>
                        		<td>${production.consumer}</td>
                        	</tr>
                        </tbody>
					</table>	
			</g:each>				
        </div>
                
    </body>
</html>
